<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>xj</title>
	</head>
	<body>
		<script>
			var arr = [1,4,6,89,2,7,543,5,61,35];
			document.write("原数组为" + arr)
			for (var j=0; j<arr.length;j++){
				for(var i=0;i<arr.length;i++){
					if(arr[i]>arr[i+1]){
						var qwe = arr[i];
						arr[i]=arr[i+1];
						arr[i+1]=qwe;
					}
				}
			}
			document.write("<p>排序后为" + arr)
		</script>
	</body>
</html>
